<?php
/**
 * Migration for user_activity table
 * 
 * @author    Evgeny Utehin <utehin@ebola.com.ua>
 * @copyright Copyright &copy; 2014 Ebola Communications 
 * @link      http://www.ebola.com.ua/ 
 */
class m140128_135659_create_useractivitylog_table extends CDbMigration
{
	const TABLE = 'user_activity';

	/**
	 * @see CDbMigration::up()
	 */
	public function up()
	{
		$this->createTable(self::TABLE, array(
			'id' 	   		=> 'pk',
			'entity'   		=> 'string not null',
			'entity_id' 	=> 'string not null',
			'user_id'  		=> 'int not null',
			'action'   		=> 'string not null',
			'previous_data' => 'text null default null',
			'current_data'  => 'text null default null',
			'description'   => 'text null default null',
			'create_time'   => 'timestamp null default null',
		));
	}

	/**
	 * @see CDbMigration::down()
	 */
	public function down()
	{
		$this->dropTable(self::TABLE);
	}
}
